package co.gov.medellin.ssti.sub.model.service.impl;

import java.util.Collection;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import co.gov.medellin.ssti.sub.common.util.Atributo;
import co.gov.medellin.ssti.sub.model.dao.ConsultasDAO;
import co.gov.medellin.ssti.sub.model.dao.exception.DAOException;
import co.gov.medellin.ssti.sub.model.service.ConsultasService;
import co.gov.medellin.ssti.sub.model.vo.AreaVO;
import co.gov.medellin.ssti.sub.model.vo.ProgramaVO;
import co.gov.medellin.ssti.sub.model.vo.SedeVO;
import co.gov.medellin.ssti.sub.model.vo.SubprogramaVO;
import co.gov.medellin.ssti.sub.model.vo.ValorFlexibleVO;
import co.gov.medellin.ssti.sub.model.vo.VflexVO;
import co.gov.medellin.ssti.sub.paoyer.administration.model.vo.UserVO;

@Service
public class ConsultasServiceImpl implements ConsultasService {
	@Autowired
	ConsultasDAO consultasDAOImpl;

	@Override
	public Collection<ProgramaVO> findDetPrograma(String strcodigo)
			throws DAOException {
		try {
			return consultasDAOImpl.findDetPrograma(strcodigo);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public Collection<SubprogramaVO> findDetSubpgr(String strsubpgr)
			throws DAOException {
		try {
			return consultasDAOImpl.findDetSubpgr(strsubpgr);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public Collection<SedeVO> findDetSede(String strSede) throws DAOException {
		try {
			return consultasDAOImpl.findDetSede(strSede);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public Collection<ProgramaVO> findNamePrograma(Long codeUser,
			String groupUserName, Long areaUser) throws DAOException {
		try {
			return consultasDAOImpl.findNamePrograma(codeUser, groupUserName,
					areaUser);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public Collection<AreaVO> findNomSubsecretaria(String strcodsecret)
			throws DAOException {
		try {
			return consultasDAOImpl.findNomSubsecretaria(strcodsecret);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public Collection<UserVO> findUsuAdmin(String strusu) throws DAOException {
		try {
			return consultasDAOImpl.findUsuAdmin(strusu);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public Collection<VflexVO> findMunicipios() throws DAOException {
		try {
			return consultasDAOImpl.findMunicipios();
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public int activarSub2(String[] param) throws DAOException {
		try {
			return consultasDAOImpl.activarSub2(param);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public int activarPro2(String[] param) throws DAOException {
		try {
			return consultasDAOImpl.activarPro2(param);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public Collection<String> findNomPrg(String strcodpro) throws DAOException {
		try {
			return consultasDAOImpl.findNomPrg(strcodpro);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public Collection<SubprogramaVO> findInfoAct(String strsubprog)
			throws DAOException {
		try {
			return consultasDAOImpl.findInfoAct(strsubprog);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public boolean valProgActivo(String strsubprg) throws DAOException {
		try {
			return consultasDAOImpl.valProgActivo(strsubprg);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public Collection<SubprogramaVO> findInfoAct2(String strsubprog)
			throws DAOException {
		try {
			return consultasDAOImpl.findInfoAct2(strsubprog);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public String nombre(String strCod) throws DAOException {
		try {
			return consultasDAOImpl.nombre(strCod);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public int findCodAtriEspe(String strCod) throws DAOException {
		try {
			return consultasDAOImpl.findCodAtriEspe(strCod);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public int findListaGeneral(String strCod) throws DAOException {
		try {
			return consultasDAOImpl.findListaGeneral(strCod);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public Collection<Atributo> findAtributoGenerico(String codsub)
			throws DAOException {
		try {
			return consultasDAOImpl.findAtributoGenerico(codsub);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public Collection<Atributo> findAtributoEspecificos(String strSubprograma,
			int opcion) throws DAOException {
		try {
			return consultasDAOImpl.findAtributoEspecificos(strSubprograma,
					opcion);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public Collection<ValorFlexibleVO> findDominio(String tipovfl)
			throws DAOException {
		try {
			return consultasDAOImpl.findDominio(tipovfl);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public Collection<ValorFlexibleVO> findDominioByCritera(String tipovfl,
			String nombre) throws DAOException {
		try {
			return consultasDAOImpl.findDominioByCritera(tipovfl, nombre);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public Collection<String> findTvflAtri(String codigo) throws DAOException {
		try {
			return consultasDAOImpl.findTvflAtri(codigo);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public Collection<Atributo> findAtriValidarLista(List<String> lNombre,
			String strSubprograma) throws DAOException {
		try {
			return consultasDAOImpl.findAtriValidarLista(lNombre,
					strSubprograma);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public Collection<Atributo> findAtriValidarLista2(List<String> lNombre,
			String strSubprograma) throws DAOException {
		try {
			return consultasDAOImpl.findAtriValidarLista2(lNombre,
					strSubprograma);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public int insertAtributo(String[] strArr, String strSubprograma)
			throws DAOException {
		try {
			return consultasDAOImpl.insertAtributo(strArr, strSubprograma);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public int insertAtributo2(String[] strArrAG, String strSubprograma)
			throws DAOException {
		try {
			return consultasDAOImpl.insertAtributo2(strArrAG, strSubprograma);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public int insertAtributoGenerico(String strCodigo, String strSubprograma,
			String[] strArr2) throws DAOException {
		try {
			return consultasDAOImpl.insertAtributoGenerico(strCodigo,
					strSubprograma, strArr2);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public int insertTipoVFL(String[] strArr) throws DAOException {
		try {
			return consultasDAOImpl.insertTipoVFL(strArr);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public int insertAtributoGene(String[] strArr) throws DAOException {
		try {
			return consultasDAOImpl.insertAtributoGene(strArr);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public int insertValorVFL(String[] strArr, int codigo) throws DAOException {
		try {
			return consultasDAOImpl.insertValorVFL(strArr, codigo);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public int findCodigoTipoVFL() throws DAOException {
		try {
			return consultasDAOImpl.findCodigoTipoVFL();
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public int findOrdenAtriGene() throws DAOException {
		try {
			return consultasDAOImpl.findOrdenAtriGene();
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public Collection<String> findCodMaxAtriGene() throws DAOException {
		try {
			return consultasDAOImpl.findCodMaxAtriGene();
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public int findOrden(String orden, String subprograma, String vigencia)
			throws DAOException {
		try {
			return consultasDAOImpl.findOrden(orden, subprograma, vigencia);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public int findOrden(String orden, String subprograma) throws DAOException {
		try {
			return consultasDAOImpl.findOrden(orden, subprograma);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public int findNombre(String nombre, String subprograma, String vigencia)
			throws DAOException {
		try {
			return consultasDAOImpl.findNombre(nombre, subprograma, vigencia);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public int findNombre(String nombre, String subprograma)
			throws DAOException {
		try {
			return consultasDAOImpl.findNombre(nombre, subprograma);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public int actualizarAtributo(String strCodigoAtri, int iCodigo,
			String[] strArrAct) throws DAOException {
		try {
			return consultasDAOImpl.actualizarAtributo(strCodigoAtri, iCodigo,
					strArrAct);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public int actualizarAtributoGene(int iCodigoAtri, int iCodigo,
			String[] strArrAct) throws DAOException {
		try {
			return consultasDAOImpl.actualizarAtributoGene(iCodigoAtri,
					iCodigo, strArrAct);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public int actualizarCampoUno(int iCodAtriEsp, int iCodAtriGene)
			throws DAOException {
		try {
			return consultasDAOImpl.actualizarCampoUno(iCodAtriEsp,
					iCodAtriGene);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public int actualizarValorSug(String strCodigoAtri, String strCodigoVFL,
			String[] strArrAct) throws DAOException {
		try {
			return consultasDAOImpl.actualizarValorSug(strCodigoAtri,
					strCodigoVFL, strArrAct);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public int actualizarValorSugGene(int codigoAtriGe, String strCodigoVFL)
			throws DAOException {
		try {
			return consultasDAOImpl.actualizarValorSugGene(codigoAtriGe,
					strCodigoVFL);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public int eliminarAtri(String strCodigoAtri, String[] strArrAct)
			throws DAOException {
		try {
			return consultasDAOImpl.eliminarAtri(strCodigoAtri, strArrAct);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public int modificarAtriSub(Atributo atri, String[] strArrAct)
			throws DAOException {
		try {
			return consultasDAOImpl.modificarAtriSub(atri, strArrAct);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public int actualizarTvfDominio(String atri) throws DAOException {
		try {
			return consultasDAOImpl.actualizarTvfDominio(atri);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public int actualizarDominio(String[] strArr, String codigo)
			throws DAOException {
		try {
			return consultasDAOImpl.actualizarDominio(strArr, codigo);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public int actualizarValorFlexible(String[] strArr, String codigo)
			throws DAOException {
		try {
			return consultasDAOImpl.actualizarValorFlexible(strArr, codigo);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public int eliminarVFL(String Codigo) throws DAOException {
		try {
			return consultasDAOImpl.eliminarVFL(Codigo);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public int eliminarVFLTotal(String codigo) throws DAOException {
		try {
			return consultasDAOImpl.eliminarVFLTotal(codigo);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

}
